package com.ruoyi.backups.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.backups.mapper.MysqlBacklogMapper;
import com.ruoyi.backups.domain.MysqlBacklog;
import com.ruoyi.backups.service.IMysqlBacklogService;

/**
 * mysql数据备份日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-06
 */
@Service
public class MysqlBacklogServiceImpl implements IMysqlBacklogService 
{
    @Autowired
    private MysqlBacklogMapper mysqlBacklogMapper;

    /**
     * 查询mysql数据备份日志
     * 
     * @param id mysql数据备份日志主键
     * @return mysql数据备份日志
     */
    @Override
    public MysqlBacklog selectMysqlBacklogById(Long id)
    {
        return mysqlBacklogMapper.selectMysqlBacklogById(id);
    }

    /**
     * 查询mysql数据备份日志列表
     * 
     * @param mysqlBacklog mysql数据备份日志
     * @return mysql数据备份日志
     */
    @Override
    public List<MysqlBacklog> selectMysqlBacklogList(MysqlBacklog mysqlBacklog)
    {
        return mysqlBacklogMapper.selectMysqlBacklogList(mysqlBacklog);
    }

    /**
     * 新增mysql数据备份日志
     * 
     * @param mysqlBacklog mysql数据备份日志
     * @return 结果
     */
    @Override
    public int insertMysqlBacklog(MysqlBacklog mysqlBacklog)
    {
        mysqlBacklog.setCreateTime(DateUtils.getNowDate());
        return mysqlBacklogMapper.insertMysqlBacklog(mysqlBacklog);
    }

    /**
     * 修改mysql数据备份日志
     * 
     * @param mysqlBacklog mysql数据备份日志
     * @return 结果
     */
    @Override
    public int updateMysqlBacklog(MysqlBacklog mysqlBacklog)
    {
        mysqlBacklog.setUpdateTime(DateUtils.getNowDate());
        return mysqlBacklogMapper.updateMysqlBacklog(mysqlBacklog);
    }

    /**
     * 批量删除mysql数据备份日志
     * 
     * @param ids 需要删除的mysql数据备份日志主键
     * @return 结果
     */
    @Override
    public int deleteMysqlBacklogByIds(Long[] ids)
    {
        return mysqlBacklogMapper.deleteMysqlBacklogByIds(ids);
    }

    /**
     * 删除mysql数据备份日志信息
     * 
     * @param id mysql数据备份日志主键
     * @return 结果
     */
    @Override
    public int deleteMysqlBacklogById(Long id)
    {
        return mysqlBacklogMapper.deleteMysqlBacklogById(id);
    }
}
